#include <iostream>
#include <string>
#include <memory>
using std::cout;
using std::endl;

#include "HttpServer.hpp"

static void Usage(std::string proc){
  cout << "Usage:\n\t" << proc << "port" << endl;
}

int main(int argc, char* argv[]){


  if(argc != 2){
    Usage(argv[0]);
    exit(4);
  }
  int port = atoi(argv[1]);

  std::shared_ptr<HttpServer> http_server(new HttpServer(port));

  http_server->InitServer();//建立Tcp连接
  http_server->Loop();//执行HttpServer中的循环处理
  

  return 0;
}
